package com.quectel.emp.vo.workorder;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 在这里编写说明
 *
 * @author: cl
 * @email: louis.cao@quectel.com
 * @date: 2022-06-08 17:33:00
 */
@Schema
@Data
public class HandleVo {
    @NotNull(message = "工单id不能为空")
    @Schema(description = "工单id")
    private Long id;
    /**
     * 状态，0未处理；1已接单；2已流转 3已完成 4已完结
     */
    @Schema(description = "状态，0未处理；1已接单；2已流转 3已完成 4已完结")
    @NotNull(message = "状态不能为空")
    private Byte status;

    /**
     * 当前经办人id
     */
    @Schema(description = "当前经办人id 指派需要")
    private Long handlerId;

    /**
     * 完工描述
     */
    @Schema(description = "完工描述 完工需要")
    @Length(max = 200, message = "完工描述最多200字")
    private String completeRemark;

    /**
     * 完工图片 json数组
     */
    @Schema(description = "完工图片 json数组 完工需要")
    private String completePictures;

    /**
     * 完工服务项目列表
     */
    @Schema(description = "服务项目")
    @Valid
    private List<ServiceItemCls> serviceItems;

    @Data
    public static class ServiceItemCls {
        @Schema(description = "服务项目id")
        @NotNull
        private Long serviceItemId;
        @Schema(description = "数量")
        @NotNull
        @Range(min = 0)
        private Integer amount;
    }

}
